using System;
using System.Collections;
using System.Collections.Generic;

namespace NanoERP.Model
{
    /// <summary>
    /// 商品信息类
    /// </summary>
    [Serializable]
    public sealed class Goodsinfo
    {
        #region Private Members

        //primary key
        private int _id;

        // Properties 
        private string _goods_no;
        private string _goods_name;
        private int? _goods_model;
        private int? _goods_type;
        private int? _goods_property;
        private int? _goods_weight;
        private int? _goods_volume;
        private string _goods_pym;
        private string _goods_spec;
        private string _packing_coef;
        private string _barcode;
        private int? _goods_directory;
        private string _goods_color;
        private string _goods_station;
        private string _goods_unit;
        private string _other_unit;
        private decimal? _ratio;
        private int? _limit_lnum;
        private int? _limit_hnum;
        private short? _is_valid;
        private int? _is_station;
        private decimal? _price_pre1;
        private decimal? _price_pre2;
        private decimal? _price_retail;
        private decimal? _price_wholesale;
        private decimal? _price_low;
        private decimal? _price_high;
        private decimal? _price_cost;
        private int? _price_costing;
        private decimal? _price_in1;
        private decimal? _price_in2;
        private DateTime? _create_date;
        private int? _create_userid;
        private int? _is_select;
        private int? _tag;
        private string _note;

        // Variabili di stato
        private bool _isChanged;

        #endregion

        #region Default ( Empty ) Class Constructor

        /// <summary>
        /// default constructor
        /// </summary>
        public Goodsinfo()
        {
            _id = 0;
            _goods_no = null;
            _goods_name = null;
            _goods_model = null;
            _goods_type = null;
            _goods_property = null;
            _goods_weight = null;
            _goods_volume = null;
            _goods_pym = null;
            _goods_spec = null;
            _packing_coef = null;
            _barcode = null;
            _goods_directory = null;
            _goods_color = null;
            _goods_station = null;
            _goods_unit = null;
            _other_unit = null;
            _ratio = null;
            _limit_lnum = null;
            _limit_hnum = null;
            _is_valid = 0;
            _is_station = null;
            _price_pre1 = null;
            _price_pre2 = null;
            _price_retail = null;
            _price_wholesale = null;
            _price_low = null;
            _price_high = null;
            _price_cost = null;
            _price_costing = null;
            _price_in1 = null;
            _price_in2 = null;
            _create_date = DateTime.Now;
            _create_userid = null;
            _is_select = null;
            _tag = null;
            _note = null;
        }

        #endregion // End of Default ( Empty ) Class Constructor

        #region Full Constructor

        /// <summary>
        /// full constructor
        /// </summary>
        public Goodsinfo(int id, string goods_no, string goods_name, int? goods_model, int? goods_type, int? goods_property, int? goods_weight, int? goods_volume, string goods_pym, string goods_spec, string packing_coef, string barcode, int? goods_directory, string goods_color, string goods_station, string goods_unit, string other_unit, decimal? ratio, int? limit_lnum, int? limit_hnum, short? is_valid, int? is_station, decimal? price_pre1, decimal? price_pre2, decimal? price_retail, decimal? price_wholesale, decimal? price_low, decimal? price_high, decimal? price_cost, int? price_costing, decimal? price_in1, decimal? price_in2, DateTime? create_date, int? create_userid, int? is_select, int? tag, string note)
        {
            _id = id;
            _goods_no = goods_no;
            _goods_name = goods_name;
            _goods_model = goods_model;
            _goods_type = goods_type;
            _goods_property = goods_property;
            _goods_weight = goods_weight;
            _goods_volume = goods_volume;
            _goods_pym = goods_pym;
            _goods_spec = goods_spec;
            _packing_coef = packing_coef;
            _barcode = barcode;
            _goods_directory = goods_directory;
            _goods_color = goods_color;
            _goods_station = goods_station;
            _goods_unit = goods_unit;
            _other_unit = other_unit;
            _ratio = ratio;
            _limit_lnum = limit_lnum;
            _limit_hnum = limit_hnum;
            _is_valid = is_valid;
            _is_station = is_station;
            _price_pre1 = price_pre1;
            _price_pre2 = price_pre2;
            _price_retail = price_retail;
            _price_wholesale = price_wholesale;
            _price_low = price_low;
            _price_high = price_high;
            _price_cost = price_cost;
            _price_costing = price_costing;
            _price_in1 = price_in1;
            _price_in2 = price_in2;
            _create_date = create_date;
            _create_userid = create_userid;
            _is_select = is_select;
            _tag = tag;
            _note = note;
        }

        #endregion // End Full Constructor

        #region Public Properties

        /// <summary>
        /// 商品ID
        /// </summary>		
        public int Id
        {
            get { return _id; }
            set { _isChanged |= (_id != value); _id = value; }
        }

        /// <summary>
        /// 商品编码
        /// </summary>		
        public string GoodsNo
        {
            get { return _goods_no; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for GoodsNo", value, value.ToString());

                _isChanged |= (_goods_no != value); _goods_no = value;
            }
        }

        /// <summary>
        /// 商品名称
        /// </summary>		
        public string GoodsName
        {
            get { return _goods_name; }
            set
            {
                if (value != null)
                    if (value.Length > 300)
                        throw new ArgumentOutOfRangeException("Invalid value for GoodsName", value, value.ToString());

                _isChanged |= (_goods_name != value); _goods_name = value;
            }
        }

        /// <summary>
        /// 商品型号
        /// </summary>		
        public int? GoodsModel
        {
            get { return _goods_model; }
            set { _isChanged |= (_goods_model != value); _goods_model = value; }
        }

        /// <summary>
        /// 商品类别 表：REFCODE
        /// </summary>		
        public int? GoodsType
        {
            get { return _goods_type; }
            set { _isChanged |= (_goods_type != value); _goods_type = value; }
        }

        /// <summary>
        /// 商品性质
        /// </summary>		
        public int? GoodsProperty
        {
            get { return _goods_property; }
            set { _isChanged |= (_goods_property != value); _goods_property = value; }
        }

        /// <summary>
        /// 体积
        /// </summary>		
        public int? GoodsWeight
        {
            get { return _goods_weight; }
            set { _isChanged |= (_goods_weight != value); _goods_weight = value; }
        }

        /// <summary>
        /// 重量
        /// </summary>		
        public int? GoodsVolume
        {
            get { return _goods_volume; }
            set { _isChanged |= (_goods_volume != value); _goods_volume = value; }
        }

        /// <summary>
        /// 拼音码
        /// </summary>		
        public string GoodsPym
        {
            get { return _goods_pym; }
            set
            {
                if (value != null)
                    if (value.Length > 300)
                        throw new ArgumentOutOfRangeException("Invalid value for GoodsPym", value, value.ToString());

                _isChanged |= (_goods_pym != value); _goods_pym = value;
            }
        }

        /// <summary>
        /// 规格
        /// </summary>		
        public string GoodsSpec
        {
            get { return _goods_spec; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for GoodsSpec", value, value.ToString());

                _isChanged |= (_goods_spec != value); _goods_spec = value;
            }
        }

        /// <summary>
        /// 包装系数
        /// </summary>		
        public string PackingCoef
        {
            get { return _packing_coef; }
            set
            {
                if (value != null)
                    if (value.Length > 300)
                        throw new ArgumentOutOfRangeException("Invalid value for PackingCoef", value, value.ToString());

                _isChanged |= (_packing_coef != value); _packing_coef = value;
            }
        }

        /// <summary>
        /// 条形码
        /// </summary>		
        public string Barcode
        {
            get { return _barcode; }
            set
            {
                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for Barcode", value, value.ToString());

                _isChanged |= (_barcode != value); _barcode = value;
            }
        }

        /// <summary>
        /// 所属目录
        /// </summary>		
        public int? GoodsDirectory
        {
            get { return _goods_directory; }
            set { _isChanged |= (_goods_directory != value); _goods_directory = value; }
        }

        /// <summary>
        /// 商品颜色
        /// </summary>		
        public string GoodsColor
        {
            get { return _goods_color; }
            set
            {
                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for GoodsColor", value, value.ToString());

                _isChanged |= (_goods_color != value); _goods_color = value;
            }
        }

        /// <summary>
        /// 货位
        /// </summary>		
        public string GoodsStation
        {
            get { return _goods_station; }
            set
            {
                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for GoodsStation", value, value.ToString());

                _isChanged |= (_goods_station != value); _goods_station = value;
            }
        }

        /// <summary>
        /// 基本单位
        /// </summary>		
        public string GoodsUnit
        {
            get { return _goods_unit; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for GoodsUnit", value, value.ToString());

                _isChanged |= (_goods_unit != value); _goods_unit = value;
            }
        }

        /// <summary>
        /// 其它单位（例：数量+单位）
        /// </summary>		
        public string OtherUnit
        {
            get { return _other_unit; }
            set
            {
                if (value != null)
                    if (value.Length > 255)
                        throw new ArgumentOutOfRangeException("Invalid value for OtherUnit", value, value.ToString());

                _isChanged |= (_other_unit != value); _other_unit = value;
            }
        }

        /// <summary>
        /// 换算比率
        /// </summary>		
        public decimal? Ratio
        {
            get { return _ratio; }
            set { _isChanged |= (_ratio != value); _ratio = value; }
        }

        /// <summary>
        /// 最低进货量
        /// </summary>		
        public int? LimitLnum
        {
            get { return _limit_lnum; }
            set { _isChanged |= (_limit_lnum != value); _limit_lnum = value; }
        }

        /// <summary>
        /// 最高进货量
        /// </summary>		
        public int? LimitHnum
        {
            get { return _limit_hnum; }
            set { _isChanged |= (_limit_hnum != value); _limit_hnum = value; }
        }

        /// <summary>
        /// 是否停用商品 1是 0否
        /// </summary>		
        public short? IsValid
        {
            get { return _is_valid; }
            set { _isChanged |= (_is_valid != value); _is_valid = value; }
        }

        /// <summary>
        /// 是否为组合型商品
        /// </summary>		
        public int? IsStation
        {
            get { return _is_station; }
            set { _isChanged |= (_is_station != value); _is_station = value; }
        }

        /// <summary>
        /// 预设售价1
        /// </summary>		
        public decimal? PricePre1
        {
            get { return _price_pre1; }
            set { _isChanged |= (_price_pre1 != value); _price_pre1 = value; }
        }

        /// <summary>
        /// 预设售价2
        /// </summary>		
        public decimal? PricePre2
        {
            get { return _price_pre2; }
            set { _isChanged |= (_price_pre2 != value); _price_pre2 = value; }
        }

        /// <summary>
        /// 零售价
        /// </summary>		
        public decimal? PriceRetail
        {
            get { return _price_retail; }
            set { _isChanged |= (_price_retail != value); _price_retail = value; }
        }

        /// <summary>
        /// 批发价
        /// </summary>		
        public decimal? PriceWholesale
        {
            get { return _price_wholesale; }
            set { _isChanged |= (_price_wholesale != value); _price_wholesale = value; }
        }

        /// <summary>
        /// 最低价
        /// </summary>		
        public decimal? PriceLow
        {
            get { return _price_low; }
            set { _isChanged |= (_price_low != value); _price_low = value; }
        }

        /// <summary>
        /// 最高价
        /// </summary>		
        public decimal? PriceHigh
        {
            get { return _price_high; }
            set { _isChanged |= (_price_high != value); _price_high = value; }
        }

        /// <summary>
        /// 成本价
        /// </summary>		
        public decimal? PriceCost
        {
            get { return _price_cost; }
            set { _isChanged |= (_price_cost != value); _price_cost = value; }
        }

        /// <summary>
        /// 成本预算方法
        /// </summary>		
        public int? PriceCosting
        {
            get { return _price_costing; }
            set { _isChanged |= (_price_costing != value); _price_costing = value; }
        }

        /// <summary>
        /// 成本价
        /// </summary>		
        public decimal? PriceIn1
        {
            get { return _price_in1; }
            set { _isChanged |= (_price_in1 != value); _price_in1 = value; }
        }

        /// <summary>
        /// 成本价
        /// </summary>		
        public decimal? PriceIn2
        {
            get { return _price_in2; }
            set { _isChanged |= (_price_in2 != value); _price_in2 = value; }
        }

        /// <summary>
        /// 创建日期
        /// </summary>		
        public DateTime? CreateDate
        {
            get { return _create_date; }
            set { _isChanged |= (_create_date != value); _create_date = value; }
        }

        /// <summary>
        /// 创建人
        /// </summary>		
        public int? CreateUserid
        {
            get { return _create_userid; }
            set { _isChanged |= (_create_userid != value); _create_userid = value; }
        }

        /// <summary>
        /// 是否查询
        /// </summary>		
        public int? IsSelect
        {
            get { return _is_select; }
            set { _isChanged |= (_is_select != value); _is_select = value; }
        }

        /// <summary>
        /// 显示顺序
        /// </summary>		
        public int? Tag
        {
            get { return _tag; }
            set { _isChanged |= (_tag != value); _tag = value; }
        }

        /// <summary>
        /// 备注
        /// </summary>		
        public string Note
        {
            get { return _note; }
            set
            {
                if (value != null)
                    if (value.Length > 3000)
                        throw new ArgumentOutOfRangeException("Invalid value for Note", value, value.ToString());

                _isChanged |= (_note != value); _note = value;
            }
        }

        #endregion

    }
}